package com.jzr.medical.db1.dto;

import com.jzr.common.util.Convert;
import com.jzr.common.util.U;
import com.jzr.medical.db1.model.TMedia;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
public class MediaDto extends TMedia {
    private Integer pageNum;
    private Integer pageSize;
    private String orderByClause;
    public String getOrderByClause(){
        if(U.isBlank(orderByClause)){
            return "dept_code,type,sort";
        }else {
            return Convert.camelToUnderline(orderByClause);
        }
    }
    public Integer getPageNum(){
        return pageNum ==null ? 1 : pageNum;
    }
    public Integer getPageSize(){
        return pageSize==null ? 20:pageSize;
    }
}
